<?php

class Blog_Controller_Browse_Index extends Nuo_Controller
{

	function execute($request)
	{

		$part = $request -> getUriPart(1);
		

		if ($part && is_id($part))
		{
			$request -> setParam('post_id', $part);
			return $request -> forward('blog/controller/browse/view');
			
		}

		Nuo::setVar('breadcrum', array(
			'title' => 'Browse People',
			'links' => array(
				'admincp' => 'AdminCP',
				'admincp/user' => 'People'
			),
			'toolbar' => 'admincp/user/browse'
		));

		$table = Nuo::getTable('blog/post');

		$select = $table -> select();

		$paging = Nuo_Paging::factory($select, $request -> getParam('page', 1), 20);

		return  $this -> render(array('paging' => $paging));
	}

}
